import java.util.Scanner;

public class StudentTester {

	public static void main(String[]  ARGC)
	{
	
		Scanner scan = new Scanner(System.in);
		
		
		final int N = 4;
		Student[] arr = new Student[N];
		
		
		
		// Collect student data
		for(int i=0;i<N;i++)
		{
			System.out.println("Enter Student Name:");
			String tmpName = scan.next();
			
			System.out.println("Enter Student avg:");
			int tmpAvg = scan.nextInt();
			
			
			arr[i] = new Student(tmpName,tmpAvg);
		}
		
		int studentAvg=0;
		int maxScoreIdx=0;

		//calculate AVG
		for (int i=0;i<N;i++)
		{
			studentAvg += arr[i].getAvg();
			
			if ( arr[ maxScoreIdx ].getAvg() <  arr[i].getAvg() )
			{
				maxScoreIdx = i;
			}
			
			
		}
	
	System.out.println("The Avg of All students is"  + (studentAvg/N)  );
	System.out.println("The TOP student is"  + arr[maxScoreIdx].getStuName() + " with score:"+arr[maxScoreIdx].getAvg()  );
	
		
		
		
		
		
	}
	
}
